package com.cd.javacxy.common.model.enums;

/**
 * @author cookie
 */

public enum MessageStatus {

    /**
     *
     */
    UNREAD(0, "未读"), READED(1, "已读");

    private final int type;

    private final String desc;

    MessageStatus(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static MessageStatus getMessageStatusByType(int type) {
        for (MessageStatus ms : MessageStatus.values()) {
            if (ms.getType() == type) {
                return ms;
            }
        }
        return null;
    }

}
